package com.medicine.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import exception.GysNotFind;
import exception.YpkcxxNotFind;
import exception.ZgxxNotFind;
import pagination.Page;
import po.Cgdd;
import po.Gys;
import po.Ypkcxx;
import po.Zgxx;
import requestvo.CgddReqVo;
import requestvo.PurchaseReqVo;
@Service
public class PurchaseService extends BaseServiceImpl{
		public Page findsbcgxx(PurchaseReqVo purchaseReqVo){
			Page<PurchaseReqVo> page=new Page<>();
			
		/*	if (purchaseReqVo.getId() != null&&!purchaseReqVo.getId().equals("")){
				page.getParams().put("ddid", purchaseReqVo.getId());
			}
				
			if(purchaseReqVo.getOrderid()!=null) 
				page.getParams().put("zgbm", purchaseReqVo.getZgbm());
			if(purchaseReqVo.getGysbm()!=null) 
				page.getParams().put("gysbm", purchaseReqVo.getGysbm());
			if(purchaseReqVo.getSl()!=null) 
				page.getParams().put("sl", purchaseReqVo.getSl());		
			if(purchaseReqVo.getDdrq()!=null&&!"".equals((purchaseReqVo.getDdrq())))
				page.getParams().put("ddrq",purchaseReqVo.getDdrq());
			if(purchaseReqVo.getDdrq1()!=null&&!"".equals((purchaseReqVo.getDdrq1())))
				page.getParams().put("ddrq1",purchaseReqVo.getDdrq1());
			if(purchaseReqVo.getDdrq2()!=null&&!"".equals((purchaseReqVo.getDdrq2())))
				page.getParams().put("ddrq2",purchaseReqVo.getDdrq2());
			if(purchaseReqVo.getYpbm()!=null&&!"".equals(purchaseReqVo.getYpbm()))
				page.getParams().put("ypbm", purchaseReqVo.getYpbm());
			if(purchaseReqVo.getYpmc()!=null&&!"".equals(purchaseReqVo.getYpmc()))
				page.getParams().put("ypmc", purchaseReqVo.getYpmc());
			
			page.setPageNo(purchaseReqVo.getPage());
			page.setPageSize(purchaseReqVo.getRows());
			page.setResults(cgddDao.findPage(page));*/
			return page;
		}
		
		
		
		public void updateCgdd(Cgdd cgdd) {
			// TODO Auto-generated method stub
			cgddDao.update(cgdd);
			
		}
		@Transactional
		public void addEquipment(PurchaseReqVo purchaseReqVo) {
			// TODO Auto-generated method stub
			applyPurchaseDao.insert(purchaseReqVo);
		/*	Ypkcxx ypkcxx=ypkcxxDao.get(cgdd.getYpbm());
			if(ypkcxx==null) throw new YpkcxxNotFind(cgdd.getYpbm());
			Gys gys=gysDao.get(cgdd.getGysbm());
			if(gys==null) throw new GysNotFind(cgdd.getGysbm());
			Zgxx zgxx=zgxxDao.get(cgdd.getZgbm());
			if(zgxx==null) throw new ZgxxNotFind(cgdd.getZgbm());*/
		}
		public void delCgdd(Integer[] integers) {
			// TODO Auto-generated method stub
			cgddDao.delete(integers);
		}

}
